﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;


namespace Cosoware.Web.Documents
{
    /// <summary>
    /// Provides access to the documents.
    /// </summary>
    public abstract class DocumentsRepositoryModuleBase : IHttpModule
    {
        /// <summary>
        /// Initializes a module and prepares it to handle requests.
        /// </summary>
        /// <param name="context">An <see cref="T:System.Web.HttpApplication"/> that provides access to the methods, properties, and events common to all application objects within an ASP.NET application</param>
        public void Init(HttpApplication context)
        {
            DocumentsRepository.Provider = GetRepositoryProvider();
        }

        /// <summary>
        /// Disposes of the resources used by the module.
        /// </summary>
        public void Dispose()
        {
        }

        protected abstract RepositoryProvider GetRepositoryProvider();
    }
}
